﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using App.Models;

namespace App.Views.ViewModels
{
    #region "服务收费项目基础数据增加编辑视图模型"
    public class ServicesItemEditViewModel
    {
        [DisplayName("编号")]
        [Required(ErrorMessage="*")]
        [RegularExpression("\\d{4}", ErrorMessage = "4位数字")]          
        public string ItemNO{get;set;}

        [Required(ErrorMessage = "*")]
        [DisplayName("名称")]
        public string ItemName{get;set;}

        [DisplayName("父类编号")]
        public IEnumerable<SelectListItem> ParentServiceID { get; set; }

        public int? ItemLevel{get;set;}

        [DisplayName("计量单位")]
        public string Unit{get;set;}

        [Required(ErrorMessage = "*")]
        [DisplayName("单价")]
        public decimal? Price{get;set;}

        [DisplayName("必选")]
        public IEnumerable<SelectListItem> Required { get; set; }

        [DisplayName("描述")]
        public string ServiceContent { get; set; }

        
    }
    #endregion

    #region "服务收费项目列表显示视图模型"
    public class UCServicesItemListViewModel : tb_ServicesItem{        
        public int Qty { get; set; }
        public bool IsSelected { get; set; }
        public bool IsPay { get; set; }
    }
    #endregion

    #region "各服务的服务收费项目扩展视图模型(只要有收费项目选择的服务都要继承此视图)"
    public class UCServicesItemListSelectViewModel {
        public IEnumerable<UCServicesItemListViewModel> ItemList { get; set; }
        public string SelectedItemList { get; set; }
    }
    #endregion
}